package cn.coastalinfo.project.drools.fact;

import lombok.Data;

import java.util.*;

/**
 * @author hadget
 * @create:24-06-110
 **/
@Data
public class RuleFact {

    //全局参数
    private Map<String, Object> map = new HashMap<String, Object>();
    //结果集
    private List result = new ArrayList<>();


    public void add(String ruleName) {
        result.add(ruleName);
    }

    public List getStrList(Object obj) {
        List r = new ArrayList<>();
        if(Objects.isNull(obj)){
            return r;
        }
        if(obj instanceof String){
            String[] sarr = ((String) obj).split(",|，");
            return new ArrayList<>(Arrays.asList(sarr)) ;
        }
        return r;
    };
}
